package net.ceviz.forum.java;

public class DoubleArray {

	public static void main(String[] args) {
		double[][] people = new double[][]{{65.21,175.9},{89.2,198.8},{55.1,170.2},{85.2,169.3}};
		
		double totalWeight=0, totalHeight=0;
		double averageWeight, averageHeight;
		for (double[] person : people) {
			totalWeight += person[0]; // ilk eleman kilo
			totalHeight += person[1]; // ikinci eleman boy
		}
		
		System.out.println("Ortalama kilo: " + (averageWeight=totalWeight/people.length));
		System.out.println("Ortalama boy: " + (averageHeight=totalHeight/people.length));
		
		// bir donguyle tekrar people' da gez
		// eger ortalama boydan "averageHeight" den boyu kisa ise yaz.
		
		for (double[] person : people) {
			if (person[1] < averageHeight) {
				System.out.print("Bodur:" + person[1] + " ");
			}
			if (person[0] < averageWeight) {
				System.out.print("Zayif:" + person[0]);
			}
			System.out.println();
		}
	}
	
}
